package com.gxa.mapper.community;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxa.dto.communitydto.OwnerDto;
import com.gxa.dto.communitydto.OwnerHouseDto;
import com.gxa.dto.communitydto.OwnerSearchDto;
import com.gxa.entity.community.Community;
import com.gxa.entity.community.Owner;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yjl
 * @since 2022-10-11 10:05:39
 */
@Mapper
public interface OwnerMapper extends BaseMapper<Owner> {
    List<OwnerDto> queryAll(OwnerSearchDto ownerSearchDto);

    //添加关系表的数据
    void addOhRelation(@Param("owner_num")String ownerNum,@Param("house_num")String houseNum,@Param("owner_type")Integer ownerTpey);

    //通过id查询
    OwnerDto queryById(Integer id);

    //通过用户的的编码查房屋的列表
    List<OwnerHouseDto> queryByOwnerNum(@Param("owner_num") String ownerNum);

    //更新关系表中的业主类型
    void updateOwnerType(@Param("owner_num") String ownerNum, @Param("owner_type") Integer ownerType);

    //判断是否重复
    List<Owner> queryByNum(@Param("owner_num") String ownerNum);
}
